package com.sws.worktive;

import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ProfileFragment extends BaseFragment implements OnClickListener{
	
	//======================== API ========================
	public static ProfileFragment newInstance(FragmentManager fragmentManager, String fragmentTag){
		ProfileFragment profileFragment = (ProfileFragment) fragmentManager.findFragmentByTag(fragmentTag);
		if (profileFragment == null) {
			profileFragment = new ProfileFragment();
			return profileFragment;
		}
		return null;
	}

	LinearLayout ll_back;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.profile_screen, container, false);

		TextView txtHeader = (TextView) view.findViewById(R.id.screen_title);
		txtHeader.setText(getResources().getString(R.string.profile));
		
		ll_back = (LinearLayout) view.findViewById(R.id.layout_back);
		ll_back.setOnClickListener(this);
		return view;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.layout_back:
			FragmentManager fragmentManager = getActivity()
					.getSupportFragmentManager();
			fragmentManager.popBackStack();
			break;

		default:
			break;
		}
		
	}
}
